FIG. 17 of the drawings attached thereto is an external view of a conventional general automatic sewing machine. The reference numeral 201 denotes a sewing machine table; 202, a needle; and 203, a thread take-up lever. A sewing-machine head 25 incorporates a mechanism for forming seams on a sewing material on an upper face of the sewing machine table 201 by the needle 202. A sewing-machine-head drive motor (hereinafter referred to as "drive motor") 24 drives the sewing-machine head 25. A sewing-machine detector 26 is arranged at an end of a spindle (not shown) of the sewing-machine head 25 for generating a signal in synchronism with rotation of the spindle of the sewing machine. An upper holder plate 204 and a lower holder plate 205 are provided for the sewing material. A work holding unit 206 retains and clamps the sewing material between the upper holding plate 204 and the lower holder plate 205 by air or the like. A bi-axial drive mechanism 208 two-dimensionally moves the work holding unit 206 on a slide plate 207 in accordance with a predetermined pattern. Origin detecting units 29 and are arranged on the bi-axial drive mechanism 208 for detecting mechanical origins of two respective axes. A control unit 209 generally controls operation of the above-described drive mechanism.
Incorporated in the control unit 209 are power switches 211 and a floppy disk drive 47 (hereinafter referred to as "FDD") for executing reading and writing with respect to a floppy disc (hereinafter referred to as "FD") 48 (not shown in FIG. 17). A foot pedal 31 and the like are connected to the magnetic-memory writing unit 47. Connected also to the magnetic-memory writing unit 47 are an operating panel 40 on which various switches for specifying the operating contents of the automatic sewing machine are set, a start switch 216 for giving a sewing start command, and a switch (hereinafter referred to as "work holding switch") 214 for holding and clamping the work holding unit 206.
Arranged on the operating panel 40 are a liquid-crystal display (hereinafter referred to as "LCD") 217 for displaying, on a screen, information such as operating procedure, messages, current sewing conditions and the like, a reset switch 212 for positioning the bi-axial drive mechanism 208 to a predetermined position to reset a system, a test switch 213 for driving the two axes in accordance with sewing data without rotation of the spindle of the sewing machine, a speed setting switch 218 for changing a rotational speed of the drive motor 24 at sewing, and a group of various switches 210 for assigning preparation, calling, erasing and the like of predetermined sewing related data.
FIG. 18 is a circuit diagram showing a schematic arrangement within the control unit 209. A microcomputer 1 includes a CPU (central processing unit) executing computation, an interrupt controller from the outside, and a direct memory access (hereinafter referred to as "DMA") for directly reading a memory without intervention of the CPU from the outside. A quartz or crystal oscillator 32 generates a fundamental frequency operating the microcomputer 1. A memory element (hereinafter referred to as "RAM") 6 is provided which is readable and writable, and a nonvolatile memory element (hereinafter referred to as "ROM") 7 is provided which is reading only. A memory address latch circuit 2 latches (self-retains) addresses of the memories (RAM 6 and ROM 7). A memory data buffer 3 transfers data from the memories (RAM 6 and ROM 7) to the microcomputer 1, or data from the microcomputer 1 to the memories (RAM 6 and ROM 7). A peripheral data buffer 4 transfers data from the microcomputer 1 to peripheral elements other than the memories (RAM 6 and ROM 7), or from the peripheral elements to the microcomputer 1. An IC select signal generating circuit (hereinafter referred to as "decoder") 5 generates an IC select signal for singly selecting the memories (RAM 6 and ROM 7) and the peripheral elements.
Further, a keyboard controller 37 controls the group of switches 210 of the operating panel 40, the speed setting switch 218 and the reset switch 212. An interface circuit 38 is provided for inputting and outputting signals of the keyboard controller 37. An LCD controller 41 drives the LCD 217 within the operating panel 40. An interface circuit 42 is provided for outputting from the LCD controller 41 and inputting from the LCD 217. An I/O 8 controls various parallel input and output signals. A pulse circuit (hereinafter referred to as "count borrow circuit") 45 generates timing at which pulses are generated by data outputted from the I/O 8 and the signal from the detector 26. Input interface circuits 10, 11 and 12 are provided into which various control signals are inputted and from which the various control signals are inputted to the I/O 8.
Further, an interrupt controller 44 receives signals from the keyboard controller 37, the count borrow circuit 45 and the detector 26 through the input interface circuit 10, to generate an interrupt signal to the microcomputer 1. A floppy disc controller (hereinafter referred to as "FDC") 46 transmits a signal to the FDD 47 and receives the signal therefrom. The FDD 47 writes data to the FD 48 that is a recording medium, by a signal from the FDC 46. A PMD 13 drives stepping motors 27 and 28 of the bi-axial drive mechanism 208 of the sewing machine. A circuit (hereinafter referred to as "motor control circuit") 49 controls the drive motor 24. A power circuit section 50 receives a signal from the motor control circuit 49 to operate the drive motor 24. A switch section (hereinafter referred to as "group of control-method switches") 15 executes setting for changing a control method of the sewing machine. A power circuit 16 supplies a power to the control unit 209.
FIG. 19 shows the count-borrow circuit 45 illustrated in FIG. 18. Components and parts which are the same as or identical with those shown in FIG. 18 are designated by the same or like reference numerals, and the description of the same or identical components and parts will be omitted. A down counter 101 reads data inputted from the CPU through the I/O 8 to count PG signals inputted from the detector 26 through the input interface circuit 10 by a set value. The down counter 101 outputs a signal when the counter is set or when the contents of the counter are brought to 0 (zero). An AND circuit 102 with inverted input and output serves not to output a signal when the down counter is set. A flip-flop circuit 103 is provided for latching (self-holding) the signal from the down counter 101.
FIG. 20(a) shows a data map within the ROM 7. The ROM 7 is divided into a system ROM 7a and a data ROM 7b as shown in FIG. 18. A program for operating the CPU and the like is stored in the system ROM 7a, while pulse data (hereinafter referred to as "feed pulses data") 220 of the bi-axial drive mechanism 208 stored and computed previously in another step, activation timing data (hereinafter referred to as "count-borrow data") 221, and sewing-speed limit data (hereinafter referred to as "speed limit data") 222 of the sewing machine are stored in the data ROM 7b. These data are conventional in a variety of automatic sewing machines. As shown in FIG. 20(b), optimum data for a seam length of 0.1-12.7 mm and sewing speeds from 2,000-200 rpm are stored in the data ROM 7b.
Operation of the conventional automatic sewing machine constructed as above will be described below. In this connection, the detailed operation of the circuit diagram shown in FIG. 18 is described in Japanese Patent Publication No. SHO 60-29515 and Japanese Patent Publication No. SHO 60-54076, and the detailed description of the operation will be omitted here. Description will be made centering around control operation of the bi-axial drive mechanism 208.
FIGS. 21, 22 and 23 are flow charts showing control operation of the bi-axial drive mechanism 208 of the conventional automatic sewing machine. FIG. 24 is a timing chart of the bi-axial drive mechanism 208, while FIG. 25 is a schematic flow chart of a count-borrow deciding method.
As illustrated in FIG. 24, a signal 401 outputted from the detector 26 is a needle upper-position signal (hereinafter referred to as "UP signal") outputted at an upper position of the needle 202, a signal 402 outputted from the detector 26 is a needle lower-position signal (hereinafter referred to as "DN signal") outputted at a lower position of the needle 202, and a signal 404 outputted from the detector 26 is a PG signal outputted in synchronism with the rotational speed of the sewing machine, while a signal 405 is a fundamental interrupt signal for controlling the PMD 13 which drives the stepping motors 27 and 28. A signal (hereinafter referred to as "BR signal") 403 controls drive timings of the respective stepping motors 27 and 28. A signal (hereinafter referred to as "stepping-motor drive signal") 406 shows a condition under which the stepping motor 27 (28) of an X-axis (Y-axis) is driven. Furthermore, waveforms 407 assume moving locus, in an X-direction and a Y-direction, of the work holding unit 206 on the slide plate 207, respectively. A waveform 408 indicates a locus of vertical movement of the thread take-up lever 203. A waveform 409 indicates a moving locus of a forward end of the needle 202.
FIG. 21 shows activation-inhibiting pulse-number setting processing (hereinafter referred to as "DN-signal interrupt processing") which is activated by detection of the DN signal 402 by the detector 26, and FIG. 22 shows fundamental interrupt-signal outputting processing (hereinafter referred to as "count-borrow interrupt processing") which is activated by outputting of the BR signal 403, while FIG. 23 shows stepping-motor drive processing which is activated by outputting of the fundamental interrupt signal.
Now, a start switch 216 is turned on whereby sewing operation is started in accordance with the sewing pattern data, the sewing speed and the like programmed beforehand. First, in FIG. 24, when the drive motor 24 drives the sewing-machine head 25, the DN signal 402 is outputted from the detector 26. The DN signal is detected whereby the DN-signal interrupt processing illustrated in FIG. 21 starts. First, a sewing speed and a sewing length of next or subsequent one stitch are fetched to the memory within the microcomputer 1 (S501). Subsequently, a number of pulses (hereinafter referred to as "CBR") corresponding to the sewing speed and the sewing length, at which processing is ended when the forward end of the needle 202 passes through the slide plate 207 (G1), are fetched to the memory (S502). The microcomputer sets the CBR to the down counter 101 shown in FIG. 19 (S503) and, simultaneously, the reset signal is set to the flip-flop circuit 103. Thus, the processing is completed.
At the time the CBR is set to the down counter 101, the BR signal 403 in FIG. 24 is brought to a low level (403a). Whenever the PG signal 404 is inputted into the down counter 101 from the detector 26 through the input interface 10, the set CBR is subtracted. When the result of the subtraction is brought to zero, the down counter 101 outputs a pulse signal from the BR-signal output terminal. By the pulse signal, the BR signal that is the output signal from the flip-flop circuit 103 is inverted so that the BR signal is brought to a high level (403b).
By the fact that the BR signal 403 is inverted to the high level (403b), the fundamental interrupt-signal outputting processing shown in FIG. 22 starts. In this processing, outputting of the fundamental interrupt signal 405 for controlling the PMD 13 is permitted to leave the processing (S504).
By the fact that the fundamental interrupt signal 405 is outputted, the stepping-motor drive processing illustrated in FIG. 23 starts. That is, the stepping-motor drive processing is executed whenever a rise point 405a of the fundamental interrupt signal 405 is detected. First, it is judged whether or not the stepping motor 27 of the X-axis is completed in movement corresponding to a seam length of one stitch (S505). If the stepping motor 27 of the X-axis is completed in movement at this time, the program branches to a step S507, while, if the stepping motor 27 is not completed in movement, the program proceeds to a step S506. The program next proceeds to a subroutine for executing drive processing of the stepping motor 27 on the side of the X-axis (S506). In this connection, the description of the stepping-motor drive processing will be omitted here. Subsequently, it is judged whether or not the stepping motor 28 in the Y-axis is completed in movement (S507). If the stepping motor 28 is completed in movement, the program branches to a step S509. If the stepping motor 28 is not completed in movement, the program proceeds to a step S508 where the program proceeds to a subroutine for executing drive processing of the stepping motor 28 on the side of the Y-axis (S508). It is judged whether or not both the stepping motors on the respective sides of the X-axis and Y-axis are completed in movement corresponding to the seam length of one stitch (S509). If the stepping motors are completed in movement, outputting of the fundamental interrupt signal 405 is inhibited to leave the processing (S510). Moreover, if any one of the movements in the X-axis and Y-axis is not ended, processing is resumed.
The CBR deciding method will be described. As shown in FIG. 25, stepping-motor drive-signal outputting time (hereinafter referred to as "FEED time") corresponding to each seam length is read (S551). Subsequently, the program enters a routine for computing a CBR range or area (S552). Here, the smallest value (hereinafter referred to as "C") of the CBR is decided depending upon a period from a time at which the DN signal 402 is outputted to a time at which the forward end of the needle 202 passes through the sliding slope 207 (G1). The largest value (hereinafter referred to as "D") of the CBR is decided depending upon a period from a time at which the DN signal 402 is outputted (402a) to a time at which the forward end of the needle 202 enters the sliding plate 207 (G2) and the FEED time. This processing is executed regarding all the sewing speeds for every seam length. The dimensions or sizes of C and D at all sewing speeds for each seam length are compared with each other (S553). If 0&lt;C.ltoreq.D, the program branches to a step 555, while, if C&gt;D, the program proceeds to a step 554. Subsequently, C is set such that C=D (S554). All C and D of each seam length for every sewing speed are decided (S555) so that processing is ended.
The CBR is capable of being set within a range of C=D by a digital switch (not shown). A rise of the BR signal has a range of from 403b indicated by the solid line to 403c indicated by the broken line. Further, an outputting period of time of the stepping-motor drive signal 406, corresponding to the rise, has a range of from the solid line (406a) to the broken line (406b).
In the conventional automatic sewing machine described above, there are problems in the relationship between the timing at which the drive processing of the stepping motor starts and the operation of the work holding unit 206, owing to the above-described control operation. These problems will be described with reference to FIGS. 24 and 26.
Now, it is assumed as an example that sewing of the sewing pattern only in one axis direction (X-axis direction) as shown in FIG. 26 is executed. In FIG. 26, the reference character L denotes a seam length of one stitch. A waveform, at which the stepping-motor drive processing at this time is converted into the moving distance, is denoted by 410 in FIG. 24. Further, it is assumed that the moving locus of the work holding unit 206 is one like 407. The output timing of the stepping-motor drive signal 406 as represented by the solid line (406a) and the broken line (406b) is capable of being set within the range between within G1 and G2 by the digital switch. Correspondingly thereto, the waveform 410, by which the stepping-motor drive processing is converted to the moving distance, is capable of being varied within 410a-410b, while the moving locus 407 of the work holding unit 206 is capable of being varied within a range of from 407a-407b. 407a indicates that movement of the work holding unit is executed during the period of time for which the forward end of the needle 202 passes out of the sewing material, while 407b indicates that moving of the work holding unit is executed also during the period of time for which the forward end of the needle 202 is in the sewing material.
Generally, the drive processing timings of the stepping motors and the moving timing of the work holding unit do not coincide with each other because of friction of the work holding unit, the load inertia, torsion and oscillation of a shaft of the drive section, and the like so that the timing at which the work holding unit starts movement is later or slower than the timing at which the drive processing of the stepping motor starts. Furthermore, these have variation due to the moving direction and the moving locations of the work holding unit.
Generally, a period during which the work holding unit 206 is capable of moving is decided depending upon the position of the needle. That is, as shown in FIG. 24, a period from the point (G1) where the forward end of the needle 202 passes out of the sewing material to the point (G2) at which the forward end of the needle 202 is again stuck into the sewing material is a period during which the work holding unit 206 is capable of moving. If the work holding unit 206 moves while the needle 202 is stuck into the sewing material, it is apparent that sewing rhythm does not become constant by curvature of a needle, damage of the needle due to contact between the needle and a hook (not shown) and occurrence of needle breakage and the like so that fine seams cannot be formed.
In view of the above-described factors, it is easily considered that the ideal and most desirable moving timing of the work holding unit is as 407a. The time at which the work holding unit starts to move is a time after the forward end of the needle 202 has passed out of the sewing material (G1), and the time at which the work holding unit has completed in movement is a time before the forward end of the needle 202 is stuck into the sewing material (G2).
As the reference technical literatures relating to the present invention, there are "Control unit For Feed Of Sewing Machine" disclosed in Japanese Patent Laid-Open No. SHO 61-37281, in addition to those mentioned previously.
Since the conventional apparatus for controlling the automatic sewing machine has been arranged as described above, there are the following problems. Specifically, since only the time during which the stepping motor is driven is processed, actual moving timing of the work holding unit is unknown. As a result, sewing quality does not become constant, a the visual quality of the seams is reduced, operability is inferior, and there is a limit in operation speed.